package org.smi;

import java.io.File;

/**
 * @Author: eee
 * @Platform: Mac
 * @Date: 12:49 PM 2018/11/3
 */
public class App2 {

    public static void main(String[] args) {
        App2 app2 = new App2();
        app2.doFile("/Users/by/Documents/H/v003");

        //File file = new File("/Users/by/Documents/H/005.mp4");
        //file.renameTo(new File("/Users/by/Documents/H/006.mp4"));
    }

    private void doFile(String path) {
        File file = new File(path);
        File[] files = file.listFiles();
        for(File f1 : files) {
            String name = f1.getName();
            if(!name.endsWith(".ts")) {
                continue;
            }
            if(name.length() == 12) {
                continue;
            }
            String name1 = name.substring(6);
            System.out.println("-" + name1);

            f1.renameTo(new File(path + "/prefix0" + name1));
        }

    }
}
